package com.starpl.mobile.android.monthunsae.november.activity;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.LinearLayout;

import com.starpl.mobile.android.monthunsae.november.R;
import com.starpl.mobile.android.monthunsae.november.handler.CommentListHandler;
import com.starpl.mobile.android.platform.common.base.BaseActivity;
import com.starpl.mobile.android.platform.component.StarplListView;

/**
 * 퀵메뉴의 내가 받은 댓글 엑티비티입니다.
 * 
 * @author 박우람, 우연화
 * @since 2011.03.10
 */
public class CommentActivity extends BaseActivity implements OnClickListener
{
	private ImageButton mIbRefresh;
	private LinearLayout mLlListLayout;
	private CommentListHandler mListHandler;
	
	@Override	
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.comment_activity);
		
		this.mIbRefresh = (ImageButton) findViewById(R.id.comment_activity_ib_refresh);
		this.mLlListLayout = (LinearLayout) findViewById(R.id.comment_activity_ll_list);
		
		mIbRefresh.setOnClickListener(this);
		
		mListHandler = new CommentListHandler(this);
		StarplListView listView = new StarplListView(mListHandler);
		mLlListLayout.addView(listView);
	}
	
	/* (non-Javadoc)
	 * @see com.starpl.platform.common.base.BaseActivity#onRestart()
	 */
	@Override
	protected void onRestart()
	{
		super.onRestart();
		mListHandler.refresh();
	}

	/* (non-Javadoc)
	 * @see android.view.View.OnClickListener#onClick(android.view.View)
	 */
	@Override
	public void onClick(View view)
	{
		switch(view.getId())
		{
		// 리프레시
		case R.id.comment_activity_ib_refresh:
			mListHandler.refresh();
			break;
		}
	}
}